import UIKit

@available(iOS, introduced: 2.0, deprecated: 9.0, message: "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead")
extension QKC where AA :UIAlertView {
     open func delegate_qk_s(_ delegate:  AnyObject? ) -> QKC<AA,YY,ZZ, AnyObject? >{
		return link(next: delegate).then_QK { $0.value.delegate = delegate }
	}
     open func delegate_qk_g() -> QKC<AA,YY,ZZ, AnyObject? >{
		 self +^ self.value.delegate
	}

    open func title_qk_s(_ title:  String) -> QKC<AA,YY,ZZ, String>{
		return link(next: title).then_QK { $0.value.title = title }
	}
    open func title_qk_g() -> QKC<AA,YY,ZZ, String>{
		 self +^ self.value.title
	}

		// secondary explanation text
    open func message_qk_s(_ message:  String? ) -> QKC<AA,YY,ZZ, String? >{
		return link(next: message).then_QK { $0.value.message = message }
	}
    open func message_qk_g() -> QKC<AA,YY,ZZ, String? >{
		 self +^ self.value.message
	}

    open func numberOfButtons_qk_g() -> QKC<AA,YY,ZZ, Int >{
		 self +^ self.value.numberOfButtons
	}

		// if the delegate does not implement -alertViewCancel:, we pretend this button was clicked on. default is -1
    open func cancelButtonIndex_qk_s(_ cancelButtonIndex:  Int ) -> QKC<AA,YY,ZZ, Int >{
		return link(next: cancelButtonIndex).then_QK { $0.value.cancelButtonIndex = cancelButtonIndex }
	}
    open func cancelButtonIndex_qk_g() -> QKC<AA,YY,ZZ, Int >{
		 self +^ self.value.cancelButtonIndex
	}

		// -1 if no otherButtonTitles or initWithTitle:... not used
    open func firstOtherButtonIndex_qk_g() -> QKC<AA,YY,ZZ, Int >{
		 self +^ self.value.firstOtherButtonIndex
	}

    open func isVisible_qk_g() -> QKC<AA,YY,ZZ, Bool >{
		 self +^ self.value.isVisible
	}

	// Alert view style - defaults to UIAlertViewStyleDefault
    @available(iOS 5.0, *)
    open func alertViewStyle_qk_s(_ alertViewStyle:  UIAlertViewStyle) -> QKC<AA,YY,ZZ, UIAlertViewStyle>{
		return link(next: alertViewStyle).then_QK { $0.value.alertViewStyle = alertViewStyle }
	}
    @available(iOS 5.0, *)
    open func alertViewStyle_qk_g() -> QKC<AA,YY,ZZ, UIAlertViewStyle>{
		 self +^ self.value.alertViewStyle
	}

	// cancel button which will be positioned based on HI requirements. buttons cannot be customized.
		// returns index of button. 0 based.
    open func addButton_qk_f(withTitle title: String?) -> QKC<AA,YY,ZZ,Int >{
		 self +^ self.value.addButton(withTitle:title)
	}

    open func buttonTitle_qk_f(at buttonIndex: Int) -> QKC<AA,YY,ZZ,String?>{
		 self +^ self.value.buttonTitle(at:buttonIndex)
	}

	// shows popup alert animated.
    open func show_qk_f() -> QKC<AA,YY,ZZ,Void>{
		 self +^ self.value.show()
	}

	// it does not need to be called if the user presses on a button
    open func dismiss_qk_f(withClickedButtonIndex buttonIndex: Int, animated: Bool) -> QKC<AA,YY,ZZ, Int>{
		 self +^ self.value.dismiss(withClickedButtonIndex:buttonIndex, animated:animated) +^ buttonIndex
	}

	// The field at index 0 will be the first text field (the single field or the login field), the field at index 1 will be the password field. */
    @available(iOS 5.0, *)
    open func textField_qk_f(at textFieldIndex: Int) -> QKC<AA,YY,ZZ,UITextField?>{
		 self +^ self.value.textField(at:textFieldIndex)
	}

}

